package com.gitee.huxing.course.conc.conc02.atomic;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Description:
 * @ProjectName: JavaCourse
 * @Package: com.gitee.huxing.course.conc.conc02
 * @ClassName: AtomicCount
 * @Author: huxing
 * @DateTime: 2021-08-23 上午9:58
 */
public class AtomicCount {

    private AtomicInteger num = new AtomicInteger(0);

    public int add(){
        return num.getAndIncrement();
    }

    public int getNum(){
        return num.get();
    }
}
